<?php
include "../proses/konek.php";
session_start();
if(!isset($_SESSION['username']))
   {   
   ?><script language="javascript">alert('anda blm login');
document.location='../'</script><?php
 }
else
{
$username = $_SESSION['username'];
$status = $_SESSION['status'];
}
$simpan2=mysql_query("SELECT * FROM  $status where email = '$username'");
$hasil2=mysql_fetch_array($simpan2);

?>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="../css/sidebar.css">
	
	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700" />
	<script type="text/javascript" src="../plugin/tinymce/tinymce.min.js"></script>
	<!-- The main CSS file -->
    <link rel="stylesheet" href="../css/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" href="../css/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/bootstrap/css/profile.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="assets/css/jquery.fileupload.css">
	<link rel="stylesheet" href="../css/bootstrap/css/bootstrap-theme.min.css">
	
<?php	
	require_once('../render.php');
	$render=new render;
	$render->icon();
	$render->navigasi();
	$render->profile($status, $username);
	
?>
	<title></title>
</head>
<body>

<div id="wrapper">
	<div id="sidebar-wrapper">
		<?php
		include ('menuslide.php');
		$menu=new menu;
		$menu->init($username, $status);
		?>
	</div>
	<div id="page-content-wrapper">
		<div class="container-fluid">
			<div class="row" style="margin-top:80px">
				<div id="subcontent"></div>
			
					<h3>PROFILE</h3>
				</div>
				<div class="">
				
			<?php
			if(!isset($_GET['e']))
			{
				?><script language="javascript">alert('DATA TIDAK ADA');
				document.location='dashboard.php'</script><?php
			} 
			else
			{
			$email=$_GET['e'];
			}
			$simpan2=mysql_query("SELECT * FROM  guru where email = '$email'");
			if(!$simpan2)
			{
				?><script language="javascript">alert('DATA TIDAK ADA');
				document.location='dashboard.php'</script><?php
			}
			else
			{

			$hasil2=mysql_fetch_array($simpan2);

			echo' <h1 class="page-title">'.$hasil2['first_name'].' '.$hasil2['last_name'].'</h1>
			<div class="panel-heading resume-heading">
		        <div class="row">
		          <div class="col-lg-12">
		            <div class="col-xs-12 col-sm-4">
		              <figure>
		                <img class="img-circle img-responsive" alt="" src="'.$hasil2['img'].'">
		              </figure>
		            </div>

		            <div class="col-xs-12 col-sm-8">
		              <ul class="list-group">
		                <li class="list-group-item">'.$hasil2['first_name'].' '.$hasil2['last_name'].'</li>
		                <li class="list-group-item">GUURU</li>
		                <li class="list-group-item">'.$hasil2['mapel'].'</li>
		                <li class="list-group-item"><i class="fa fa-phone"></i> 000-000-0000 </li>
		                <li class="list-group-item"><i class="fa fa-envelope"></i> '.$hasil2['email'].'</li>
		              </ul>
		            </div>
		          </div>
		        </div>
		      </div>';
		      $result = mysql_query("select * from posting where author='$email'");
		      while ($list = mysql_fetch_assoc($result)) {
					echo'			
				  <div class="row">    
		            <br>
		            <div class="col-md-10 col-sm-9">
		              <h3><?php
									'.$list['judul'].';
								?></h3>
		              <div class="row">
		                <div class="col-xs-9">
		                  <p><?php
									'.$list['isi'].';
								?></p>
		                  <p class="lead"><span class="btn btn-default" ><a href="view.php? id='.$list['idpost'].'">Read More</a></span></p>
		                  <p class="pull-right"><span class="label label-default">keyword</span> <span class="label label-default">tag</span> <span class="label label-default">post</span></p>
		                  <ul class="list-inline"><li><a href="#">2 Days Ago</a></li><li><a href="#"><i class="glyphicon glyphicon-comment"></i> 4 Comments</a></li><li><a href="#"><i class="glyphicon glyphicon-share"></i> 34 Shares</a></li></ul>
		                  </div>
		                <div class="col-xs-3"></div>
		              </div>
		              <br><br>
		            </div>
		          </div>';
		                					
			}
					} // end while
		      ?>

				</div>
				
			</div>
			 
		</div>
		</div>
		<div>
<?php
$render->footer();
?>			
		</div>
<!-- JQuery Core -->


<script src="../js/search.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
		
<script type="text/javascript" src="../css/bootstrap/js/bootstrap.js"></script>
<!-- Custom Sidebar Javascript--> 
<script type="text/javascript" src="../js/metisMenu.min.js"></script>
<script src="../js/sb-admin-2.js"></script>
<script type="text/javascript" src="../js/sidebar.js"></script>
<!-- Custom Javascript Load Page-->

</body>
</html>

	
